<?php
session_start();

if(isset($_POST['txtFName']))
{
	$fName = $_POST['txtFName'];
	$lName = $_POST['txtLName']; 
	$email =  $_POST['txtEmail'];
	$pwd =  $_POST['txtPwd'];	
	$lastLogin = date ("Y-m-d H:i:s");

	require_once 'database.php';
	
	$sql = "INSERT INTO forumuser (FName,LName,Email,pwd,LastLogin,IsActive)
			VALUES
			('$fName','$lName','$email','$pwd','$lastLogin',1)";
	
	mysql_query($sql);
	
	mysql_close();
}
?>
<html>
<head>
<title> Template </title>
<?php
require_once 'headerFiles.html';
?>
<script type="text/javascript" src="script/jquery.validate.min.js"> 
</script>
</head>
<body>
	<div id="mainContainer">
		<?php
		require_once 'Header.php';		
		?>
		<div id="content">
		<br /><br />
		<?php

		if(isset($_SESSION['fname']))
		{
			echo "<b>Welcome ".$_SESSION['fname']." </b>";
			require_once 'AskQuest_Content.php';
		}
		else
		{
			?>
			<script type="text/javascript">
			window.location = "Index.php";
			</script>
			<?php
		}		
		?>
		</div>
		<?php
		require_once 'footer.html';		
		?>
	</div>
	<?php
	if(isset($_POST['txtFName']))
	{
	?>
	<script type="text/javascript" >
	alert('Record added succesfully');
	</script>
	<?php
	}
	?>
	<script type="text/javascript">
	$("#frmQuestion").validate();
	</script>
</body>
</html>
